package com.yss.netty.config;

import com.yss.netty.util.Constants;

public final class NettyServerConfig {

    /**
     * Init tcp queue
     */
    private int soBacklog = 1024;

    /**
     * Whether tcp delay
     */
    private boolean tcpNoDelay = true;

    /**
     * Send buffer size
     */
    private int sendBufferSize = 65535;

    /**
     * Receive buffer size
     */
    private int receiveBufferSize = 65535;

    /**
     * Listener port
     */
    private int listenerPort = 12345;

    private int bossThreadNum = 1;

    private int workerThreadNum = Constants.CPUS;

    public static final boolean SO_REUSEADDR = true;

    public static final boolean SO_KEEPALIVE = true;

    public int getSoBacklog() {
        return soBacklog;
    }

    public void setSoBacklog(int soBacklog) {
        this.soBacklog = soBacklog;
    }

    public boolean isTcpNoDelay() {
        return tcpNoDelay;
    }

    public void setTcpNoDelay(boolean tcpNoDelay) {
        this.tcpNoDelay = tcpNoDelay;
    }

    public int getSendBufferSize() {
        return sendBufferSize;
    }

    public void setSendBufferSize(int sendBufferSize) {
        this.sendBufferSize = sendBufferSize;
    }

    public int getReceiveBufferSize() {
        return receiveBufferSize;
    }

    public void setReceiveBufferSize(int receiveBufferSize) {
        this.receiveBufferSize = receiveBufferSize;
    }

    public int getListenerPort() {
        return listenerPort;
    }

    public void setListenerPort(int listenerPort) {
        this.listenerPort = listenerPort;
    }

    public int getBossThreadNum() {
        return bossThreadNum;
    }

    public void setBossThreadNum(int bossThreadNum) {
        this.bossThreadNum = bossThreadNum;
    }

    public int getWorkerThreadNum() {
        return workerThreadNum;
    }

    public void setWorkerThreadNum(int workerThreadNum) {
        this.workerThreadNum = workerThreadNum;
    }
}
